#!/bin/bash
rm -rf *.o
rm -rf *.gch
rm -rf main
rm -rf convey

gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c xml_lib.c xml_lib.h  -I/usr/include/libxml2/
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c mysql_lib.c mysql_lib.h  -I/usr/local/mysql/include/mysql -DUNIV_LINUX
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c dict_lib.h dict_lib.c  
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c conf_lib.c conf_lib.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c memcache_lib.c memcache_lib.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c action_lib.c action_lib.h 
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c proc_data_lib.c proc_data_lib.h -I/usr/local/mysql/include/mysql -DUNIV_LINUX
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c socket_lib.c socket_lib.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c thread_lib.c thread_lib.h -I/usr/local/mysql/include/mysql -DUNIV_LINUX 
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c mem_lib.c mem_lib.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c time_lib.c time_lib.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c daemon_lib.c daemon_lib.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c log_lib.c log_lib.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c signal_lib.c signal_lib.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c error_lib.c error_lib.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c store_lib.c store_lib.h  -I/usr/local/mysql/include/mysql -DUNIV_LINUX

gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c convey_lib.c convey_lib.h -I/usr/local/mysql/include/mysql -DUNIV_LINUX
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c json.c json.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c json_lib.c json_lib.h
#gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c status_lib.c status_lib.h -lcrypto
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c status_lib.c status_lib.h  -I/usr/local/mysql/include/mysql -DUNIV_LINUX


#gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c record_lib.c record_lib.h -I/usr/local/mysql/include/mysql -DUNIV_LINUX


#gcc -g -o main main.c socket_lib.o conf_lib.o libevent_lib.o -levent
#   -lcrypto
gcc -g -o main main.c json.o json_lib.o socket_lib.o conf_lib.o status_lib.o  mysql_lib.o daemon_lib.o signal_lib.o convey_lib.o error_lib.o log_lib.o  mem_lib.o time_lib.o store_lib.o dict_lib.o proc_data_lib.o  xml_lib.o action_lib.o thread_lib.o memcache_lib.o  -lxml2  -rdynamic -L/usr/local/mysql/lib/mysql -lmysqlclient_r -lpthread -lz -lcrypt -lnsl -lm -levent -lcrypto -I/usr/local/mysql/include/mysql


#gcc -g -o convey convey.c conf_lib.o sdb_struct.o log_lib.o socket_lib.o convey_lib.o mysql_lib.o error_lib.o -rdynamic -L/usr/local/mysql/lib/mysql -lmysqlclient_r -lpthread -lz -lcrypt -lnsl -lm -I/usr/local/mysql/include/mysql

